#ifndef _KDNODE_H
#define _KDNODE_H

#include <vector>

using std::vector;

class KDNode {
public:
    vector<double>* data = nullptr;
    KDNode* left = nullptr;
    KDNode* right = nullptr;
    KDNode* parent = nullptr;

    int split = 0;
    double dist = 0;

private:
    int dim = 0;

public:
     KDNode() { }

     KDNode(vector<double>* data) : data(data) {}

     KDNode(vector<double>* data, int split, KDNode* left, KDNode* right) : data(data), split(split), left(left), right(right), dim(data->size()) { }

    // int CompareTo(KDNode other)
    //{
    //    return this.dist < other.dist ? 1 : (this.dist == other.dist ? 0 : -1);
    //}
     bool operator>(const KDNode& other) const {
         return dist > other.dist;
     }
     bool operator<(const KDNode& other) const {
         return dist < other.dist;
     }


};


#endif